#define 初心高于胜负_成长大于输赢 1

#include <algorithm>
#include <cstddef>
#include <iostream>
#include <ostream>
#include <string>

class BigNumber {
public:
  // 由于C++内置数据类型无法存储30位十进制数字，所以使用字符串来处理大数
  std::string m_num;

  // 构造函数
  BigNumber();
  BigNumber(const std::string &num);
  // 判断这个数是否是负数
  bool isNega() const;
  // 判断这个数是否是浮点数
  bool isFloat() const;
  // 交换两个数字
  void mySwap(BigNumber &num);
  // 求数字的绝对值
  BigNumber myAbs() const;
  // 为数据传入的数据打标签(正负、整数还是浮点数) 以便归于基本的四则运算
  int target(BigNumber &num) const;
  // 规范化数字格式
  std::string normalize();
  // 比较操作数1是否大于等于操作数2，是则返回true
  bool compare(const BigNumber &num) const;
  // 小数点对齐函数
  int alignDecimal(BigNumber &num);

  // 重载 + 运算符
  BigNumber operator+(const BigNumber &num) const;
  // 重载 - 运算符
  BigNumber operator-(const BigNumber &num) const;
  // 重载 * 运算符
  BigNumber operator*(const BigNumber &num) const;
  // 重载 / 运算符
  BigNumber operator/(const BigNumber &num) const;

private:
  // 两个大数(正整数)相加
  std::string myAdd(const BigNumber &num) const;
  // 两个大数(正整数)相减
  std::string mySub(const BigNumber &num) const;
  // 两个大数(正整数)相乘
  std::string myMul(const BigNumber &num) const;
  // 两个大数(正整数)相除
  std::string myDiv(const BigNumber &num) const;
};

// 重载 << 运算符
std::ostream &operator<<(std::ostream &out, const BigNumber &num) {
  std::string s = num.m_num;

  // 处理负号
  bool negative = false;
  if (!s.empty() && s[0] == '-') {
    negative = true;
    s.erase(0, 1);
  }

  // 如果是以 '.' 开头，前面补 '0'
  if (!s.empty() && s[0] == '.') {
    s = "0" + s;
  }

  // 如果小数点在负号后立刻出现，也要补 '0'
  if (s.size() >= 2 && s[0] == '-' && s[1] == '.') {
    s.insert(1, "0");
  }

  // 还原负号
  if (negative && s != "0") {
    s = "-" + s;
  }

  out << s;
  return out;
}

// 比较操作数1是否大于等于操作数2，是则返回true
bool BigNumber::compare(const BigNumber &num) const {
  std::string a = this->m_num;
  std::string b = num.m_num;

  // 分割整数部分和小数部分
  std::string a_int, a_frac, b_int, b_frac;

  size_t pos_a = a.find('.');
  if (pos_a == std::string::npos) {
    a_int = a;
    a_frac = "";
  } else {
    a_int = a.substr(0, pos_a);
    a_frac = a.substr(pos_a + 1);
  }

  size_t pos_b = b.find('.');
  if (pos_b == std::string::npos) {
    b_int = b;
    b_frac = "";
  } else {
    b_int = b.substr(0, pos_b);
    b_frac = b.substr(pos_b + 1);
  }

  // 先比较整数部分长度
  if (a_int.size() != b_int.size()) {
    return a_int.size() > b_int.size();
  }

  // 整数部分长度相同 → 逐位比较
  for (size_t i = 0; i < a_int.size(); i++) {
    if (a_int[i] != b_int[i]) {
      return a_int[i] > b_int[i];
    }
  }

  // 整数部分相等 → 比较小数部分
  size_t maxFrac =
      a_frac.size() > b_frac.size() ? a_frac.size() : b_frac.size();

  // 补齐短的小数部分
  while (a_frac.size() < maxFrac)
    a_frac += '0';
  while (b_frac.size() < maxFrac)
    b_frac += '0';

  for (size_t i = 0; i < maxFrac; i++) {
    if (a_frac[i] != b_frac[i]) {
      return a_frac[i] > b_frac[i];
    }
  }

  // 完全相等
  return true;
}

///////////////////////////////////////////////////////////////////////////////////
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\数据清洗标签模块\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
///////////////////////////////////////////////////////////////////////////////////

BigNumber::BigNumber() { m_num = "0"; }
BigNumber::BigNumber(const std::string &num) { this->m_num = num; }

bool BigNumber::isNega() const { return (this->m_num[0] == '-'); }

bool BigNumber::isFloat() const {
  int pos = this->m_num.find('.');
  return !(pos == -1);
}

void BigNumber::mySwap(BigNumber &num) {
  std::string temp = this->m_num;
  this->m_num = num.m_num;
  num.m_num = temp;
}

// 去除字符串左侧的前导 '0'，如果结果为空则返回 "0"
// 输入例子："000123" -> "123" ; "000" -> "0"
static std::string stripLeadingZeros(const std::string &s) {
    size_t p = s.find_first_not_of('0');
    if (p == std::string::npos) return std::string("0");
    return s.substr(p);
}

// 比较两个无符号整数字符串（假设输入可能带前导零）
// 返回： 1 表示 a>b, 0 表示 a==b, -1 表示 a<b
static int compareUnsigned(const std::string &a_in, const std::string &b_in) {
    // 先去掉前导零，保证长度比较正确
    std::string a = stripLeadingZeros(a_in);
    std::string b = stripLeadingZeros(b_in);
    if (a.size() > b.size()) return 1;
    if (a.size() < b.size()) return -1;
    if (a == b) return 0;
    return (a > b) ? 1 : -1; // 字典序比较适用于同长度数字字符串
}

// 计算 a - b，输入假设：a 和 b 为无符号整数字符串，且 a >= b（数值上）
// 返回结果已去掉前导零，若相等则返回 "0"
static std::string subtractUnsigned(const std::string &a_in, const std::string &b_in) {
    // 先去前导零以简化处理
    std::string a = stripLeadingZeros(a_in);
    std::string b = stripLeadingZeros(b_in);

    // 特例：如果 b == "0"，直接返回 a
    if (b == "0") return a;
    // 特例：如果 a == b，返回 "0"
    if (a == b) return std::string("0");

    int i = (int)a.size() - 1;
    int j = (int)b.size() - 1;
    int borrow = 0;
    std::string rev;          // 先把低位结果 push_back 到 rev，再 reverse

    // 从最低位到最高位逐位相减
    while (i >= 0) {
        int da = a[i] - '0';
        int db = (j >= 0) ? (b[j] - '0') : 0;
        int val = da - db - borrow;
        if (val < 0) {
            val += 10;
            borrow = 1;
        } else {
            borrow = 0;
        }
        rev.push_back(char('0' + val));
        i--; j--;
    }

    // 去掉结果的高位多余的 '0'（现在在 rev 的末尾）
    while (rev.size() > 1 && rev.back() == '0') rev.pop_back();
    // 翻转得到最终结果
    std::reverse(rev.begin(), rev.end());
    return stripLeadingZeros(rev);
}


// 小数点对齐函数
int BigNumber::alignDecimal(BigNumber &num) {
  std::string &a = this->m_num;
  std::string &b = num.m_num;

  // 找小数点位置
  int pos_a = a.find('.');
  int pos_b = b.find('.');

  // 计算各自小数位数
  int dec_a = (pos_a == std::string::npos) ? 0 : (a.size() - pos_a - 1);
  int dec_b = (pos_b == std::string::npos) ? 0 : (b.size() - pos_b - 1);

  int max_dec = std::max(dec_a, dec_b);

  // 去掉小数点
  if (pos_a != std::string::npos) {
    a.erase(pos_a, 1);
  }
  if (pos_b != std::string::npos) {
    b.erase(pos_b, 1);
  }

  // 补齐小数位，保证对齐
  a.append(max_dec - dec_a, '0');
  b.append(max_dec - dec_b, '0');

  return max_dec;
}

int BigNumber::target(BigNumber &num) const {
  if (!(this->isFloat()) && !(num.isFloat())) {
    // 两个数都是整数
    if (!this->isNega()) {
      if (!num.isNega()) {
        // 两个数都是正数
        return 1;
      } else {
        // 操作数1是正数，操作数2是负数
        return 2;
      }
    } else {
      if (!num.isNega()) {
        // 操作数1是负数，操作数2是正数
        return 3;
      } else {
        // 两个数都是负数
        return 4;
      }
    }
  } else {
    // 两个数中有浮点数
    if (!this->isNega()) {
      if (!num.isNega()) {
        // 两个数都是正数
        return 5;
      } else {
        // 操作数1是正数，操作数2是负数
        return 6;
      }
    } else {
      if (!num.isNega()) {
        // 操作数1是负数，操作数2是正数
        return 7;
      } else {
        // 两个数都是负数
        return 8;
      }
    }
  }
}

// 规范化数字格式
std::string BigNumber::normalize() {
  // 滤除空格，Tab键，回车键
  std::string temp;
  for (char c : this->m_num) {
    if (c != ' ' && c != '\t' && c != '\r' && c != '\n') {
      temp.push_back(c);
    }
  }
  // 如果没有内容，就把输入的大数初始为0，并退出函数
  if (temp.empty()) {
    return "0";
  }
  // 判断是否为负数，是的话就先把负号拿掉，便于清洗数据
  bool negative = false;
  if (temp[0] == '+') {
    temp.erase(0, 1);
  } else if (temp[0] == '-') {
    temp.erase(0, 1);
    negative = true;
  }
  // 首先判断是否为浮点数
  int pos = temp.find('.');
  if (pos == std::string::npos) {
    // 是整数
    // 去除前导0
    size_t pos_0 = temp.find_first_not_of('0');
    if (pos_0 == std::string::npos) {
      temp = "0";
    } else {
      temp = temp.substr(pos_0);
    }
  } else {
    // 是小数
    // 分为整数部分和小数部分处理
    std::string intpart = temp.substr(0, pos);
    std::string fracpart = temp.substr(pos + 1);
    // 去掉整数部分的前导0
    size_t pos_int_0 = intpart.find_first_not_of('0');
    if (pos_int_0 == std::string::npos) {
      intpart = "0";
    } else {
      intpart = intpart.substr(pos_int_0);
    }
    // 去掉小数的尾部0
    size_t pos_end_0 = fracpart.find_last_not_of("0");
    if (pos_end_0 == std::string::npos) {
      temp = intpart;
    } else {
      fracpart = fracpart.substr(0, pos_end_0 + 1);
      temp = intpart + '.' + fracpart;
    }
  }
  if (negative) {
    return '-' + temp;
  } else {
    return temp;
  }
}

///////////////////////////////////////////////////////////////////////////////////
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\加法操作模块\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
///////////////////////////////////////////////////////////////////////////////////

std::string BigNumber::myAdd(const BigNumber &num) const {
  // 获取两个大数便于操作
  std::string a = this->m_num;
  std::string b = num.m_num;
  size_t maxLength = std::max(a.size(), b.size());
  // 位数不够的自动补上前导0
  while (a.size() < maxLength) {
    a = '0' + a;
  }
  while (b.size() < maxLength) {
    b = '0' + b;
  }
  // 逐个计算结果
  // temp承载进位数，result承载结果
  int temp = 0;
  std::string result(maxLength + 1, '0');
  for (int i = maxLength - 1; i >= 0; i--) {
    int total = (a[i] - '0') + (b[i] - '0') + temp;
    result[i + 1] = total % 10 + '0';
    temp = total / 10;
  }
  result[0] = temp + '0';
  return result;
}

BigNumber BigNumber::operator+(const BigNumber &num) const {
  BigNumber result;
  result.m_num = this->myAdd(num);
  result.m_num = result.normalize();
  return result;
}

///////////////////////////////////////////////////////////////////////////////////
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\减法操作模块\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
///////////////////////////////////////////////////////////////////////////////////

std::string BigNumber::mySub(const BigNumber &num) const {
  std::string a = this->m_num;
  std::string b = num.m_num;
  bool negative = false;
  if (!this->compare(num)) {
    negative = true;
    std::string temp = a;
    a = b;
    b = temp;
  }
  // 补齐 b 的长度
  while (b.size() < a.size()) {
    b = std::string("0") + b;
  }

  std::string result(a.size(), '0');
  int borrow = 0;

  // 从低位向高位逐位相减
  for (int i = static_cast<int>(a.size()) - 1; i >= 0; i--) {
    int diff = (a[i] - '0') - (b[i] - '0') - borrow;
    if (diff < 0) {
      diff += 10;
      borrow = 1;
    } else {
      borrow = 0;
    }
    result[i] = diff + '0';
  }

  // 去掉前导零
  size_t pos = result.find_first_not_of('0');
  if (pos != std::string::npos) {
    result = result.substr(pos);
  } else {
    result = "0"; // 如果全是零
  }
  if (negative) {
    result = '-' + result;
  }
  return result;
}

BigNumber BigNumber::operator-(const BigNumber &num) const {
  BigNumber result;
  result.m_num = this->mySub(num);
  result.m_num = result.normalize();
  return result;
}

///////////////////////////////////////////////////////////////////////////////////
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\乘法操作模块\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
///////////////////////////////////////////////////////////////////////////////////

// 两个大数(正整数)相乘
std::string BigNumber::myMul(const BigNumber &num) const {
  std::string a = this->m_num;
  std::string b = num.m_num;
  int n = a.size(), m = b.size();
  std::string result(n + m, '0');

  for (int i = n - 1; i >= 0; i--) {
    int carry = 0;
    for (int j = m - 1; j >= 0; j--) {
      int tmp = (result[i + j + 1] - '0') + (a[i] - '0') * (b[j] - '0') + carry;
      result[i + j + 1] = (tmp % 10) + '0';
      carry = tmp / 10;
    }
    // 处理最前面的进位，可能需要连锁处理
    int k = i;
    while (carry > 0 && k >= 0) {
      int sum = (result[k] - '0') + carry;
      result[k] = (sum % 10) + '0';
      carry = sum / 10;
      k--;
    }
  }
  return result; // 暂时不处理前导零
}

BigNumber BigNumber::operator*(const BigNumber &num) const {
  BigNumber result;
  result.m_num = this->myMul(num);
  result.m_num = result.normalize();
  return result;
}

///////////////////////////////////////////////////////////////////////////////////
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\除法操作模块\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
///////////////////////////////////////////////////////////////////////////////////

// 两个大数(正整数)相除，支持小数，精度由参数控制
std::string BigNumber::myDiv(const BigNumber &num) const {
    const int accuracy = 20; // 小数精度，可按需修改

    // 取被除数、除数字符串（注意这里不处理负号与小数点）
    std::string dividend = this->m_num;
    std::string divisor  = num.m_num;

    // 不允许除数为 "0"
    if (stripLeadingZeros(divisor) == "0") {
        throw std::runtime_error("除数不能为0");
    }

    // 去掉前导零（保持一致性）
    dividend = stripLeadingZeros(dividend);
    divisor  = stripLeadingZeros(divisor);

    // 如果被除数为 0，直接返回 "0"
    if (dividend == "0") return std::string("0");

    // 计算整数部分（长除法）
    // 当前余数
    std::string remainder = std::string(""); 
     // 整数商的每一位（暂时包含可能的前导零）
    std::string intPart;                    

    // 对被除数的每一位做“下拉一位并试商”的操作（手工竖式）
    for (size_t i = 0; i < dividend.size(); ++i) {
        // 把被除数下一位“下拉”到余数后面
        remainder.push_back(dividend[i]);

        // 去掉余数前导零（因为可能有 "00..."）
        remainder = stripLeadingZeros(remainder);

        // 现在在余数中尝试减去除数尽可能多次（每位商的范围 0..9）
        int cnt = 0;
        // 当 remainder >= divisor 时，做一次 remainder = remainder - divisor，并增加 cnt
        while (compareUnsigned(remainder, divisor) >= 0) {
            remainder = subtractUnsigned(remainder, divisor);
            cnt++;
            // 理论上 cnt 不会超过 9（十进制每一位），这里加个保险防止死循环
            if (cnt > 20) break;
        }
        // 把本次商位添加到整数商字符串
        intPart.push_back(char('0' + cnt));
    }

    // 去掉整数商的前导零；若全为零则设为 "0"
    intPart = stripLeadingZeros(intPart);

    // 如果恰好整除（余数为 0），直接返回整数商
    if (remainder == "0") {
        return intPart;
    }

    //余数不为 0：计算小数部分
    // 小数位字符串
    std::string fracPart; 
    for (int k = 0; k < accuracy; ++k) {
        // 把余数下移一位（相当于在手工竖式中在余数后面添一个 '0'）
        remainder.push_back('0');
        remainder = stripLeadingZeros(remainder);

        int cnt = 0;
        while (compareUnsigned(remainder, divisor) >= 0) {
            remainder = subtractUnsigned(remainder, divisor);
            cnt++;
            if (cnt > 20) break;
        }
        fracPart.push_back(char('0' + cnt));

        // 如果当前余数为 0，说明可以提前结束小数部分计算
        if (remainder == "0") break;
    }

    // 去掉小数部分末尾多余的 '0'
    while (!fracPart.empty() && fracPart.back() == '0') fracPart.pop_back();

    // 组织最终结果：若小数部分为空说明实际上整除（理论上前面已返回）
    if (fracPart.empty()) {
        return intPart;
    } else {
        return intPart + std::string(".") + fracPart;
    }
}

BigNumber BigNumber::operator/(const BigNumber &num) const {
  BigNumber result;
  result.m_num = this->myDiv(num);
  result.m_num = result.normalize();
  return result;
}

///////////////////////////////////////////////////////////////////////////////////
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\主函数\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
///////////////////////////////////////////////////////////////////////////////////

int main(int argc, char *argv[]) {
  if (argc != 4) {
    std::cout << "请按  ./calc 操作数1 计算符号( + - x ) 操作数2 的形式输入"
              << std::endl;
    return -1;
  }
  // 获取操作数并对操作数进行处理
  BigNumber num1(argv[1]);
  num1.m_num = num1.normalize();
  BigNumber num2(argv[3]);
  num2.m_num = num2.normalize();
  std::string op = argv[2];
  if (op == "+") {
    switch (num1.target(num2)) {
    case 1: {
      std::cout << num1 + num2 << std::endl;
      break;
    }
    case 2: {
      num2.m_num.erase(0, 1);
      std::cout << num1 - num2 << std::endl;
      break;
    }
    case 3: {
      num1.m_num.erase(0, 1);
      std::cout << num2 - num1 << std::endl;
      break;
    }
    case 4: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      std::cout << "-" << (num1 + num2) << std::endl;
      break;
    }
    case 5: {
      // 对齐操作
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num1 + num2;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << result << std::endl;
      break;
    }
    case 6: {
      num2.m_num.erase(0, 1);
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num1 - num2;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << result << std::endl;
      break;
    }
    case 7: {
      num1.m_num.erase(0, 1);
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num2 - num1;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << result << std::endl;
      break;
    }
    case 8: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num1 + num2;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << "-" << result << std::endl;
      break;
    }
    }
  } else if (op == "-") {
    switch (num1.target(num2)) {
    case 1: {
      std::cout << num1 - num2 << std::endl;
      break;
    }
    case 2: {
      num2.m_num.erase(0, 1);
      std::cout << num1 + num2 << std::endl;
      break;
    }
    case 3: {
      num1.m_num.erase(0, 1);
      std::cout << "-" << num1 + num2 << std::endl;
      break;
    }
    case 4: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      std::cout << num2 - num1 << std::endl;
      break;
    }
    case 5: {
      // 对齐操作
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num1 - num2;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << result << std::endl;
      break;
    }
    case 6: {
      // 对齐操作
      num2.m_num.erase(0, 1);
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num1 + num2;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << result << std::endl;
      break;
    }
    case 7: {
      // 对齐操作
      num1.m_num.erase(0, 1);
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num1 + num2;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << "-" << result << std::endl;
      break;
    }
    case 8: {
      // 对齐操作
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      int decimalPlaces = num1.alignDecimal(num2);
      BigNumber result = num2 - num1;
      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= decimalPlaces) {
        result.m_num.insert(0, decimalPlaces - result.m_num.size() + 1, '0');
      }
      result.m_num.insert(result.m_num.size() - decimalPlaces, ".");
      std::cout << result << std::endl;
      break;
    }
    }
  } else if (op == "x") {
    switch (num1.target(num2)) {
    case 1: {
      std::cout << num1 * num2 << std::endl;
      break;
    }
    case 2: {
      num2.m_num.erase(0, 1);
      std::cout << "-" << num1 * num2 << std::endl;
      break;
    }
    case 3: {
      num1.m_num.erase(0, 1);
      std::cout << "-" << num1 * num2 << std::endl;
      break;
    }
    case 4: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      std::cout << num1 * num2 << std::endl;
      break;
    }
    case 5: {
      // 对齐操作，获取两个数的小数位数
      int decA = num1.alignDecimal(num2);
      int totalDecimal = decA + decA;

      BigNumber result = num1 * num2;

      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= totalDecimal) {
        result.m_num.insert(0, totalDecimal - result.m_num.size() + 1, '0');
      }

      // 插入小数点
      result.m_num.insert(result.m_num.size() - totalDecimal, ".");
      result.m_num = result.normalize();

      std::cout << result << std::endl;
      break;
    }
    case 6: {
      num2.m_num.erase(0, 1);
      // 对齐操作，获取两个数的小数位数
      int decA = num1.alignDecimal(num2);
      int totalDecimal = decA + decA;

      BigNumber result = num1 * num2;

      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= totalDecimal) {
        result.m_num.insert(0, totalDecimal - result.m_num.size() + 1, '0');
      }

      // 插入小数点
      result.m_num.insert(result.m_num.size() - totalDecimal, ".");
      result.m_num = result.normalize();

      std::cout << "-" << result << std::endl;
      break;
    }
    case 7: {
      num1.m_num.erase(0, 1);
      // 对齐操作，获取两个数的小数位数
      int decA = num1.alignDecimal(num2);
      int totalDecimal = decA + decA;

      BigNumber result = num1 * num2;

      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= totalDecimal) {
        result.m_num.insert(0, totalDecimal - result.m_num.size() + 1, '0');
      }

      // 插入小数点
      result.m_num.insert(result.m_num.size() - totalDecimal, ".");
      result.m_num = result.normalize();

      std::cout << "-" << result << std::endl;
      break;
      break;
    }
    case 8: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      // 对齐操作，获取两个数的小数位数
      int decA = num1.alignDecimal(num2);
      int totalDecimal = decA + decA;

      BigNumber result = num1 * num2;

      // 如果整数部分不够长，补前导零
      if (result.m_num.size() <= totalDecimal) {
        result.m_num.insert(0, totalDecimal - result.m_num.size() + 1, '0');
      }

      // 插入小数点
      result.m_num.insert(result.m_num.size() - totalDecimal, ".");
      result.m_num = result.normalize();

      std::cout << result << std::endl;
      break;
      break;
    }
    }
  } else if (op == "%") {
    switch (num1.target(num2)) {
    case 1: {
      std::cout << num1 / num2 << std::endl;
      break;
    }
    case 2: {
      num2.m_num.erase(0, 1);
      std::cout << "-" << num1 / num2 << std::endl;
      break;
    }
    case 3: {
      num1.m_num.erase(0, 1);
      std::cout << "-" << num1 / num2 << std::endl;
      break;
    }
    case 4: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      std::cout << num1 / num2 << std::endl;
      break;
    }
      // 对于小数，将小数点对其映射为整数，直接进行计算
    case 5: {
      num1.alignDecimal(num2);
      std::cout << num1 / num2 << std::endl;
      break;
    }
    case 6: {
      num2.m_num.erase(0, 1);
      num1.alignDecimal(num2);
      std::cout << "-" << num1 / num2 << std::endl;
      break;
    }
    case 7: {
      num1.m_num.erase(0, 1);
      num1.alignDecimal(num2);
      std::cout << "-" << num1 / num2 << std::endl;
      break;
    }
    case 8: {
      num1.m_num.erase(0, 1);
      num2.m_num.erase(0, 1);
      num1.alignDecimal(num2);
      std::cout << num1 / num2 << std::endl;
      break;
    }
    }
  }
  return 0;
}